package com.hospital.view.TabManager;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import com.hospital.activity.R;
import com.hospital.adapter.TimelineAdapter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by wangjun on 2015/6/10.
 */
public class ManagerTab01Fragment extends Fragment {


    private  ListView mListView;
    private  TimelineAdapter timelineAdapter;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.activity_listview,container,false);
        mListView = (ListView) view.findViewById(R.id.listview);
        //   mProgressBar = (ProgressBar) view.findViewById(R.id.manager_list_pro);
        //   empty = (RelativeLayout) view.findViewById(R.id.empty_layout);
        mListView.setDividerHeight(0);
        timelineAdapter = new TimelineAdapter(this.getActivity(), getData());
        mListView.setAdapter(timelineAdapter);
        return view;
    }

    private List<Map<String, Object>> getData() {
        List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();

        Map<String, Object> map = new HashMap<String, Object>();
        map.put("title", "小");
        list.add(map);

        map = new HashMap<String, Object>();
        map.put("title", "球");
        list.add(map);

        map = new HashMap<String, Object>();
        map.put("title", "是");
        list.add(map);

        map = new HashMap<String, Object>();
        map.put("title", "S");
        list.add(map);

        map = new HashMap<String, Object>();
        map.put("title", "B");
        list.add(map);
        return list;
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        //  getData();
    }
}


